<template>
  <div class="common-layout">
    <el-container>
      <el-header>XXX后台管理系统</el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu
              active-text-color="#ffd04b"
              background-color="#545c64"
              class="el-menu-vertical-demo"
              default-active="2"
              text-color="#fff"
              @open="handleOpen"
              @close="handleClose"
              :router="true"
          >
            <el-sub-menu index="1">
              <template #title>
                <el-icon><Position /></el-icon>
                <span>用户管理</span>
              </template>
              <el-menu-item index="/index/userlist">用户列表</el-menu-item>
              <el-menu-item index="1-2">添加用户</el-menu-item>
              <el-menu-item index="1-3">修改用户</el-menu-item>
            </el-sub-menu>
            <el-sub-menu index="2">
              <template #title>
                <el-icon><Position /></el-icon>
                <span>角色管理</span>
              </template>
              <el-menu-item index="2-1">角色列表</el-menu-item>
              <el-menu-item index="2-2">添加角色</el-menu-item>
              <el-menu-item index="2-3">修改角色</el-menu-item>
            </el-sub-menu>
            <el-sub-menu index="3">
              <template #title>
                <el-icon><Position /></el-icon>
                <span>支付管理</span>
              </template>
              <el-menu-item index="3-1">支付列表</el-menu-item>
              <el-menu-item index="3-2">添加支付</el-menu-item>
              <el-menu-item index="3-3">修改支付</el-menu-item>
            </el-sub-menu>
          </el-menu>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
import {test} from "../api/user.js";

export default {
  name: "Index"
  ,data(){
    return {

    }
  }
  ,methods:{
    async testFun(){
      let data = await test();
      console.log(data)
    }
    ,handleOpen(index){
      console.log('open'+index)
    }
    ,handleClose(index){
      console.log('close'+index)
    }
  }
}
</script>
<style scoped>
.el-header{
  background-color: #545C64;
}
</style>